package cn.kgc.entity;

import java.math.BigDecimal;
import java.util.Date;
import java.io.Serializable;

import cn.kgc.commons.annoation.Dict;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.*;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.math.BigDecimal;

/**
 * 采购信息(WmsPurchase)表实体类
 *
 * @author makejava
 * @since 2022-12-07 11:06:15
 */
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(value = "wms_purchase")
@SuppressWarnings("serial")
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public class WmsPurchase extends Model<WmsPurchase> implements Serializable {

    @TableId(type = IdType.AUTO)
    private Long id; //主键


    /**
     * 采购人id
     **/
    @TableField(value = "assignee_id")
    private Long assigneeId;


    /**
     * 采购人名
     **/
    @TableField(value = "assignee_name")
    private String assigneeName;


    /**
     * 联系方式
     **/
    @TableField(value = "phone")
    private String phone;


    /**
     * 优先级
     **/
    @TableField(value = "priority")
    private Integer priority;


    /**
     * 状态[0新建，1已分配，2正在采购，3已完成，4采购失败]
     **/
    @TableField(value = "status")
    @Dict(dictCode = "purchase_status")
    private Integer status;


    /**
     * 仓库id
     **/
    @TableField(value = "ware_id")
    private Long wareId;


    /**
     * 总金额
     **/
    @TableField(value = "amount")
    private BigDecimal amount;


    @TableField(value = "creationdate", fill = FieldFill.INSERT)
    @JsonIgnore
    private Date creationdate; //创建时间


    @TableField(value = "modifydate", fill = FieldFill.UPDATE)
    @JsonIgnore
    private Date modifydate; //修改时间


    @Version
    private int version;   //版本


    @TableLogic
    @JsonIgnore
    @TableField(fill = FieldFill.INSERT)
    private int deleted;  //逻辑删除标志


}
